# CMakeLists.txt for HALCON Qt matching example
# Copyright (c) 2022-2022 by MVTec Software GmbH
cmake_minimum_required(VERSION 3.7.1)

# If policy CMP0091 is available, set it to NEW to enable use of the
# CMAKE_MSVC_RUNTIME_LIBRARY variable.
if(POLICY CMP0091)
  cmake_policy(SET CMP0091 NEW)
endif()

project(HalconQtMatchingExample CXX)

# Append HALCON's cmake directory to the module path. This requires the
# HALCONEXAMPLES environment variable to be set.
file(TO_CMAKE_PATH "$ENV{HALCONEXAMPLES}" HALCONEXAMPLES)
list(APPEND CMAKE_MODULE_PATH "${HALCONEXAMPLES}/cmake")

# Option for using HALCON XL.
option(HALCON_XL "Use HALCON XL" ON)

# Include common settings for HALCON projects.
include(UseHALCON)

# Find the Qt5 'Widgets' package. Note that we will also need the 'Core' and
# 'Gui' packages, but the 'Widgets' package will take care of these dependencies
# for us.
find_package(Qt5Widgets)

# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)


# Set C++17 standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(mainwindow
  source/main.cpp
  source/mainwindow.cpp
  source/mainwindow.h
  source/qhalconwindow.cpp
  source/qhalconwindow.h)
target_link_libraries(mainwindow Qt5::Widgets HALCON::CppInt)
